
import Vue from 'vue'
import axios from 'axios'
import VueAxios from 'vue-axios'

Vue.use(VueAxios, axios)

//对axios进行封装，调用起来方便
const httpRequest = axios.create({
    baseURL: 'http://localhost:8989/rbac-system/',//基本地址
    timeout: 1000,//超时时间
    headers: { 'Content-Type': 'application/json' },//请求头
    // `responseType` 表示服务器响应的数据类型，可以是 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'
    responseType: 'json', // default
    // `responseEncoding` indicates encoding to use for decoding responses
    // Note: Ignored for `responseType` of 'stream' or client-side requests
    responseEncoding: 'utf8', // default
});


export default httpRequest;